﻿#include "LuaThread.h"
#include "LuaState.h"
#include "LuaObjectImpl.h"
#include "LuaFunction.h"

LuaThread::LuaThread()
    :LuaObject()
{
}

LuaThread::LuaThread(LuaObjectImpl* impl)
    : LuaObject(impl)
{
}

LuaThread::LuaThread(LuaState* owner)
    :LuaObject(LuaObjectImpl::createThread(owner))
{
}


LuaThread::~LuaThread()
{
}

bool LuaThread::isValid()
{
	return getType() == LUA_TTHREAD;
}

LuaState* LuaThread::thread()
{
    if (m_ptr)
        return m_ptr->getLuaThread();
    else
        return NULL;
}

